package com.example.demo;

import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.Metrics;
import org.springframework.stereotype.Service;

/**
 * @author lizhien (zhien.li@nascent.cn)
 * @version 1.0.0
 * @date 2022/3/18 16:02
 * @description com.example.demo
 */

@Service("collectorService")
public class CollectorService {

    static final Counter userCounter = Metrics.counter("user.counter.total", "services", "demo");

    public void processCollectResult() throws InterruptedException {
        while (true) {
            userCounter.increment(1D);
        }
    }
}
